<%@page contentType="text/html; charset=utf-8"%>
<%@page import="dao.UserDao"%>
<%@page import="dao.DaoFactory"%>
<%@page import="java.util.List"%>
<%@page import="entity.User"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<html>
	<head>
		<title>emplist</title>
		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
		<link rel="stylesheet" type="text/css" href="css/style.css" />
	</head>
	<body>
		<div id="wrap">
			<div id="top_content">
				<div id="header">
					<div id="rightheader">
						<p>
							2009/11/20
							<br />
						</p>
					</div>
					<div id="topheader">
						<h1 id="title">
							<a href="#">Main</a>
						</h1>
					</div>
					<div id="navigation">
					</div>
				</div>

				<div id="content">
					<p id="whereami">
					</p>
					<h1>
						Welcome!用户列表
					</h1>
					<table class="table">
						<tr class="table_header">
							<td>
								ID
							</td>
							<td>
								Username
							</td>
							<td>
								Gender
							</td>
							<td>
								Age
							</td>
							<td>

							</td>
							<td>

							</td>
							<td>

							</td>
						</tr>
						<s:iterator value="users" var="u" status="status">
							<tr class="row<s:property value="#status.count%2+1"/>">
								<td>
									<s:property value="#u.id"/>
								</td>
								<td>
									<s:property value="#u.userName"/>
								</td>
								<td>
									<s:if test="#u.gender==1">男</s:if>
									<s:else>女</s:else>
								</td>
								<td>
									<s:property value="#u.age"/>
								</td>
								<td>
									<a href="user!detail.do?user.id=<s:property value="#u.id"/>">详细</a>
								</td>
								<td>
									<a href="user!update_finduser.do?user.id=<s:property value="#u.id"/>">更新</a>
								</td>
								<td>
									<a onclick="return confirm('是否删除？')" href="user!delete.do?user.id=<s:property value="#u.id"/>">删除</a>
								</td>
							</tr>
						</s:iterator>
					</table>
					<hr/>
					<table class="table">
						<tr class="table_header">
							<td>
								ID
							</td>
							<td>
								Username
							</td>
							<td>
								Gender
							</td>
							<td>
								Age
							</td>
						</tr>
						<s:iterator value="users" status="status">
						<tr class="row<s:property value="#status.count%2+1"/>">
							<td><s:property value="id"/></td>
							<td><s:property value="userName"/></td>
							<td>
									<s:if test="gender==1">男</s:if>
									<s:else>女</s:else>
								</td>
							<td><s:property value="age"/></td>
						</tr>
						</s:iterator>
					</table>
					<hr/>
					<s:debug></s:debug>
					<p>
						<input type="button" class="button" value="退出系统"
							onclick="location='user!logout.do'" />
							<input type="button" class="button" value="添加用户"
							onclick="location='addUser.jsp'" />
					</p>
				</div>
			</div>
			<div id="footer">
				<div id="footer_bg">
					ABC@126.com
				</div>
			</div>
		</div>
	</body>
</html>
